import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import _ from "lodash";
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'index',
    component: () => import("@/views/index/index"),
  },
  {
    path: '/questionnaire',
    name: 'questionnaire',
    component: () => import("@/views/questionnaire/questionnaire"),
  },
  {
    path: '/insure',
    name: 'insure',
    component: () => import("@/views/insure/insure"),
  },
  {
    path: '/saler',
    name: 'saler',
    component: () => import("@/views/saler/saler"),
    meta: {
      title: '妇女保业务员',
    }
  },
  {
    // 订单列表
    path: '/orderList',
    name: 'orderList',
    component: () => import("@/views/orderList/orderList"),
    meta: {
      title: '订单中心',
    }
  },
  {
    // 订单详情
    path: '/orderDetail',
    name: 'orderDetail',
    component: () => import("@/views/orderDetail/orderDetail"),
    meta: {
      title: '订单详情',
    }
  },
  {
    path: '/orderSearch',
    name: 'orderSearch',
    component: () => import("@/views/orderSearch/orderSearch"),
    meta: {
      title: '订单查询',
    }
  },
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

router.afterEach((to,form) => {
  (document as any).title = to.meta.title;
})

export default router;
